<template>
  <router-layout id="__index">
    <!-- 上汽保险 -->
    <van-tabbar v-if="companyId == 6" v-model="active" slot="footer" fixed>
      <van-tabbar-item to="/Container">
        <span>主页</span>
        <img slot="icon" slot-scope="props" :src="props.active ? icon.active : icon.normal">
      </van-tabbar-item>
      <van-tabbar-item dot to="/messageHome">
        <span>消息</span>
        <img slot="icon" width="22" slot-scope="props" :src="props.active ? icon.active1 : icon.normal1">
      </van-tabbar-item>
      <van-tabbar-item>
        <div class="add-bg" @click.stop="show=!show">
          <div class="add-menu">
            <img  src="https://gw.alicdn.com/tfs/TB1dOroUQvoK1RjSZFwXXciCFXa-165-164.png" width="100%" height="100%">
          </div>
        </div>
      </van-tabbar-item>
      <van-tabbar-item to="/Address">
        <span>认可</span>
        <img slot="icon" slot-scope="props" :src="props.active ? icon.active4 : icon.normal4">
      </van-tabbar-item>
      <van-tabbar-item to="/sqbxMe">
        <span>我的</span>
        <img slot="icon" slot-scope="props" :src="props.active ? icon.active2: icon.normal2">
      </van-tabbar-item>
    </van-tabbar>
    <!-- 安吉物流 -->
    <van-tabbar v-else-if="companyId == 3" v-model="active" slot="footer" fixed>
      <van-tabbar-item to="/Container">
        <span>主页</span>
        <img slot="icon" slot-scope="props" :src="props.active ? icon.active : icon.normal">
      </van-tabbar-item>
      <van-tabbar-item dot to="/messageHome">
        <span>消息</span>
        <img slot="icon" width="22" slot-scope="props" :src="props.active ? icon.active1 : icon.normal1">
      </van-tabbar-item>
      <van-tabbar-item>
        <div class="add-bg" @click.stop="show=!show">
          <div class="add-menu">
            <img  src="https://gw.alicdn.com/tfs/TB1dOroUQvoK1RjSZFwXXciCFXa-165-164.png" width="100%" height="100%">
          </div>
        </div>
      </van-tabbar-item>
      <van-tabbar-item to="/Address">
        <span>吉榜</span>
        <img slot="icon" slot-scope="props" :src="props.active ? icon.active3 : icon.normal3">
      </van-tabbar-item>
      <van-tabbar-item to="/sqbxMe">
        <span>我的</span>
        <img slot="icon" slot-scope="props" :src="props.active ? icon.active2: icon.normal2">
      </van-tabbar-item>
    </van-tabbar>
    <!-- 联合电子 -->
    <van-tabbar v-else-if="companyId == 8" v-model="active" slot="footer" fixed>
      <van-tabbar-item to="/Container">
        <span>主页</span>
        <img slot="icon" slot-scope="props" :src="props.active ? icon1.active : icon1.normal">
      </van-tabbar-item>
      <van-tabbar-item to="/messageHome">
        <span>消息</span>
        <img slot="icon" slot-scope="props" :src="props.active ? icon1.active1 : icon1.normal1">
      </van-tabbar-item>
      <van-tabbar-item to="/Address">
        <span>点赞</span>
        <img slot="icon" slot-scope="props" :src="props.active ? icon1.active3 : icon1.normal3">
      </van-tabbar-item>
      <van-tabbar-item to="/sqbxMe">
        <span>我的</span>
        <img slot="icon" slot-scope="props" :src="props.active ? icon1.active2: icon1.normal2">
      </van-tabbar-item>
    </van-tabbar>
    <!-- 其他默认 -->
    <van-tabbar v-else v-model="active" slot="footer" fixed>
      <van-tabbar-item to="/Container">
        <span>主页</span>
        <img slot="icon" slot-scope="props" :src="props.active ? icon2.active : icon2.normal">
      </van-tabbar-item>
      <van-tabbar-item to="/messageHome">
        <span>消息</span>
        <img slot="icon" slot-scope="props" :src="props.active ? icon2.active1 : icon2.normal1">
      </van-tabbar-item>
      <van-tabbar-item to="/Address">
        <span>认可</span>
        <img slot="icon" slot-scope="props" :src="props.active ? icon2.active3 : icon2.normal3">
      </van-tabbar-item>
      <van-tabbar-item to="/sqbxMe">
        <span>我的</span>
        <img slot="icon" slot-scope="props" :src="props.active ? icon2.active2: icon2.normal2">
      </van-tabbar-item>
    </van-tabbar>
    <!-- 底部弹框 -->
    <div v-if="companyId == 3" class="van-popup-box">
      <van-popup class="popup-box" position="bottom" v-model="show">
        <div class="one">
          <van-row>
            <van-col span="6">
              <router-link :to="{path:'/proposalHome', query:{nameLink:'proposalAdd'}}">
                <div class="list">
                  <img src="https://gw.alicdn.com/tfs/TB1PFVsX2WG3KVjSZFgXXbTspXa-79-75.png" alt>
                  <p>合理化建议</p>
                </div>
              </router-link>
            </van-col>
            <van-col span="6">
              <router-link to="/VoteHome">
                <div class="list">
                  <img src="https://gw.alicdn.com/tfs/TB1U64yX8Gw3KVjSZFDXXXWEpXa-76-84.png" alt>
                  <p>投票</p>
                </div>
              </router-link>
            </van-col>
            <van-col span="6">
              <router-link to="/SurveyHome">
                <div class="list">
                  <img src="https://gw.alicdn.com/tfs/TB1b0XtX8GE3KVjSZFhXXckaFXa-68-82.png" alt>
                  <p>问卷</p>
                </div>
              </router-link>
            </van-col>
          </van-row>
        </div>
      </van-popup>
    </div>
    <div v-else class="van-popup-box">
      <van-popup class="popup-box" position="bottom" v-model="show">
        <div class="one">
          <van-row>
            <van-col span="6">
              <router-link to="/ActivityHome">
                <div class="list">
                  <img src="https://gw.alicdn.com/tfs/TB1JaLiUQvoK1RjSZFNXXcxMVXa-54-54.png" alt>
                  <p>活动</p>
                </div>
              </router-link>
            </van-col>
            <van-col span="6">
              <router-link :to="{path:'/CommunityHome', query:{nameLink:'articleAdd'}}">
                <div class="list">
                  <img src="https://gw.alicdn.com/tfs/TB1BSu.UMDqK1RjSZSyXXaxEVXa-66-57.png" alt>
                  <p>论坛</p>
                </div>
              </router-link>
            </van-col>
            <van-col span="6">
              <router-link :to="{path:'/proposalHome', query:{nameLink:'proposalAdd'}}">
                <div class="list">
                  <img src="https://gw.alicdn.com/tfs/TB1ofYeUNTpK1RjSZFKXXa2wXXa-51-52.png" alt>
                  <p>合理化建议</p>
                </div>
              </router-link>
            </van-col>
            <van-col span="6">
              <router-link to="/VoteHome">
                <div class="list">
                  <img src="https://gw.alicdn.com/tfs/TB1m8reUOrpK1RjSZFhXXXSdXXa-46-51.png" alt>
                  <p>投票</p>
                </div>
              </router-link>
            </van-col>
            <van-col span="6">
              <router-link :to="{path:'/StudyHome', query:{content_type:0}}">
                <div class="list">
                  <img src="https://gw.alicdn.com/tfs/TB1e8fhUSzqK1RjSZFpXXakSXXa-61-51.png" alt>
                  <p>学习</p>
                </div>
              </router-link>
            </van-col>
          </van-row>
        </div>
      </van-popup>
    </div>
    <div class="content">
      <router-view></router-view>
    </div>
  </router-layout>
</template>
<script>
export default {
  // https://gw.alicdn.com/tfs/TB1dOroUQvoK1RjSZFwXXciCFXa-165-164.png
  name: "component_name",
  data() {
    return {
      show: false,
      companyId: localStorage.getItem("companyId") - 0,
      active: 0,
      icon: {
        normal:
          "https://gw.alicdn.com/tfs/TB1lRPgUQzoK1RjSZFlXXai4VXa-46-38.png",
        active:
          "https://gw.alicdn.com/tfs/TB1z0HtUNYaK1RjSZFnXXa80pXa-44-36.png",
        normal1:
          "https://gw.alicdn.com/tfs/TB1cUzhUPTpK1RjSZKPXXa3UpXa-41-34.png",
        active1:
          "https://gw.alicdn.com/tfs/TB1McbkUQPoK1RjSZKbXXX1IXXa-41-34.png",
        normal2:
          "https://gw.alicdn.com/tfs/TB1dRDeUNTpK1RjSZFMXXbG_VXa-37-40.png",
        active2:
          "https://gw.alicdn.com/tfs/TB1OaniUIbpK1RjSZFyXXX_qFXa-37-41.png",
          // 安吉物流
        normal3:
          "https://gw.alicdn.com/tfs/TB1M5GPX2WG3KVjSZFPXXXaiXXa-41-42.png",
        active3:
          "https://gw.alicdn.com/tfs/TB1xduRX81D3KVjSZFyXXbuFpXa-41-42.png",
          // 保险
        normal4:
          "https://gw.alicdn.com/tfs/TB1Dlxlb2c3T1VjSZPfXXcWHXXa-35-37.png",
        active4:
          "https://gw.alicdn.com/tfs/TB1dnTUUSzqK1RjSZFLXXcn2XXa-35-37.png"
      },
      icon1: {
        normal:
 "./../../../static/img/lhdz/zhuye.png",
        active:
          "https://gw.alicdn.com/tfs/TB1N4r.UQvoK1RjSZFwXXciCFXa-37-37.png",
        normal1:
          "./../../../static/img/lhdz/xiaoxi.png",
        active1:
          "https://gw.alicdn.com/tfs/TB1GJEdUNYaK1RjSZFnXXa80pXa-37-31.png",
        normal2:
          "./../../../static/img/lhdz/wode.png",
        active2:
          "https://gw.alicdn.com/tfs/TB1gNnqUSzqK1RjSZPcXXbTepXa-37-37.png",
        normal3:
          "./../../../static/img/lhdz/dianzhan.png",
        active3:
          "https://gw.alicdn.com/tfs/TB1dnTUUSzqK1RjSZFLXXcn2XXa-35-37.png"
      },
      icon2: {
        normal:
          "https://gw.alicdn.com/tfs/TB1PkphOmzqK1RjSZFLXXcn2XXa-66-68.png",
        active:
          "https://gw.alicdn.com/tfs/TB15otgOmzqK1RjSZPxXXc4tVXa-62-64.png",
        normal1:
          "https://gw.alicdn.com/tfs/TB1bCFpOjTpK1RjSZKPXXa3UpXa-84-66.png",
        active1:
          "https://gw.alicdn.com/tfs/TB1z30kOlLoK1RjSZFuXXXn0XXa-84-66.png",
        normal2:
          "https://gw.alicdn.com/tfs/TB1Bw0kOlLoK1RjSZFuXXXn0XXa-66-68.png",
        active2:
          "https://gw.alicdn.com/tfs/TB1m_8dOmrqK1RjSZK9XXXyypXa-62-64.png",
        normal3:
          "https://gw.alicdn.com/tfs/TB1RUVkOb2pK1RjSZFsXXaNlXXa-68-68.png",
        active3:
          "https://gw.alicdn.com/tfs/TB1TNpiObPpK1RjSZFFXXa5PpXa-68-68.png"
      }
    };
  },
  created() {},
  methods: {

  },
  mounted() {

  }
};
</script>
<style  lang="scss" scoped>
.content {
  height: 100%;
  padding-bottom: 50px;
}
.add-bg {
  position: fixed;
  width: 100%;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  border-radius: 50%;
  width: 70px;
  height: 70px;
  background-color: #fff;
  z-index: 66;
}
.add-menu {
  position: fixed;
  width: 100%;
  top: 50%;
  left: 50%;
  transform: translate(-48%,-49%);
  width: 95px;
  height: 95px;
}
.van-popup-box {
  width: 100%;
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 1;
}
.popup-box {
  padding-bottom: 50px;
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
}
.one {
  padding: 20px 0 0;
  .list {
    text-align: center;
    padding-bottom: 20px;
    img {
      margin: 0 auto;
      height: 27px;
    }
    p {
      padding-top: 10px;
      font-size: 12px;
    }
  }
}
</style>
